//
//  CargoTVCell.m
//  Logistics
//
//  Created by enzhoukeji on 2018/8/8.
//  Copyright © 2018年 puyue.com. All rights reserved.
//

#import "CargoTVCell.h"

@implementation CargoTVCell

-(void)loadViews{
    self.addressLable = [UILabel labelWithSize:[UIFont systemFontOfSize:12] withColor:[UIColor blackColor] withText:@"地址信息"];
    self.provenanceLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:14] withColor:[UIColor blackColor] withText:@"济南"];
//    self.provenanceLabel.textAlignment = NSTextAlignmentCenter;
    self.jianTouImage = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"jiantou"]];
    
    self.destinationLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:14] withColor:[UIColor blackColor] withText:@"杭州 嘉兴"];
    self.destinationLabel.textAlignment = NSTextAlignmentCenter;
    self.distanceLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:11] withColor:[UIColor blackColor] withText:@"约300公里"];
    [self addSubview:self.addressLable];
    [self addSubview:self.provenanceLabel];
    [self addSubview:self.jianTouImage];
    [self addSubview:self.destinationLabel];
    [self addSubview:self.distanceLabel];
}
-(void)layoutViews {
    [self.addressLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(GTFixWidthFlaot(15)));
        make.top.equalTo(@(GTFixHeightFlaot(5)));
        make.height.equalTo(@(GTFixHeightFlaot(15)));
        make.width.equalTo(self.addressLable.mas_width);
    }];
    [self.provenanceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(GTFixWidthFlaot(15)));
        make.top.equalTo(self.addressLable.mas_bottom).offset(GTFixHeightFlaot(3));
        make.height.equalTo(@(GTFixHeightFlaot(20)));
        make.width.equalTo(self.provenanceLabel.mas_width);
    }];
    [self.jianTouImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.provenanceLabel.mas_right).offset(GTFixWidthFlaot(0));
        make.top.equalTo(self.addressLable.mas_bottom).offset(GTFixHeightFlaot(10));
        make.height.mas_equalTo(GTFixHeightFlaot(8));
        make.width.mas_equalTo(GTFixWidthFlaot(25));
    }];
    [self.destinationLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.jianTouImage.mas_right).offset(GTFixWidthFlaot(0));
        make.top.equalTo(self.addressLable.mas_bottom).offset(GTFixHeightFlaot(3));
        make.height.mas_equalTo(GTFixHeightFlaot(20));
        make.width.mas_equalTo(self.destinationLabel.mas_width);
    }];
    [self.distanceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(GTFixWidthFlaot(15)));
        make.top.mas_equalTo(self.provenanceLabel.mas_bottom).offset(GTFixHeightFlaot(3));
        make.height.equalTo(@(GTFixHeightFlaot(15)));
        make.width.equalTo(self.distanceLabel.mas_width);
    }];
}
@end

@implementation CargoTVCellSecond
-(void)loadViews {
    self.informationLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:13] withColor:[UIColor blackColor] withText:@"货物信息"];
    self.informationLabel.textAlignment = NSTextAlignmentCenter;
    self.typeLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:12] withColor:[UIColor blackColor] withText:@"货物类型"];
    self.typeLabel.textAlignment = NSTextAlignmentCenter;
    self.weightLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:12] withColor:[UIColor blackColor] withText:@"重量"];
    self.weightLabel.textAlignment = NSTextAlignmentCenter;
    self.isOrNoLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:12] withColor:[UIColor blackColor] withText:@"是否零担"];
    self.isOrNoLabel.textAlignment = NSTextAlignmentCenter;
    self.machineLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:12] withColor:[UIColor grayColor] withText:@"机器"];
    self.machineLabel.textAlignment = NSTextAlignmentCenter;
    self.kgLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:12] withColor:[UIColor grayColor] withText:@"180顿"];
    self.kgLabel.textAlignment = NSTextAlignmentCenter;
    self.noLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:12] withColor:[UIColor grayColor] withText:@"否"];
    self.noLabel.textAlignment = NSTextAlignmentCenter;
    [self addSubview:self.informationLabel];
    [self addSubview:self.typeLabel];
    [self addSubview:self.weightLabel];
    [self addSubview:self.isOrNoLabel];
    [self addSubview:self.machineLabel];
    [self addSubview:self.kgLabel];
    [self addSubview:self.noLabel];

}
-(void)layoutViews {
    [self.informationLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(GTFixWidthFlaot(15)));
        make.top.equalTo(@(GTFixHeightFlaot(5)));
        make.height.equalTo(@(GTFixHeightFlaot(15)));
        make.width.equalTo(self.informationLabel.mas_width);
    }];
    [self.typeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(GTFixWidthFlaot(0)));
        make.top.mas_equalTo(self.informationLabel.mas_bottom).offset(GTFixHeightFlaot(5));
        make.height.equalTo(@(GTFixHeightFlaot(15)));
        make.width.mas_equalTo(kMainScreen_width/3);
    }];
    [self.weightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.typeLabel.mas_right).offset(1);
        make.top.mas_equalTo(self.informationLabel.mas_bottom).offset(GTFixHeightFlaot(5));
        make.height.equalTo(@(GTFixHeightFlaot(15)));
        make.width.mas_equalTo(kMainScreen_width/3);
    }];
    [self.isOrNoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.weightLabel.mas_right).offset(1);
        make.top.mas_equalTo(self.informationLabel.mas_bottom).offset(GTFixHeightFlaot(5));
        make.height.equalTo(@(GTFixHeightFlaot(15)));
        make.width.mas_equalTo(kMainScreen_width/3);
    }];

    [self.machineLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(GTFixWidthFlaot(0)));
        make.top.mas_equalTo(self.typeLabel.mas_bottom).offset(GTFixHeightFlaot(5));
        make.height.equalTo(@(GTFixHeightFlaot(15)));
        make.width.mas_equalTo(kMainScreen_width/3);
    }];
    [self.kgLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.machineLabel.mas_right).offset(1);
        make.top.mas_equalTo(self.typeLabel.mas_bottom).offset(GTFixHeightFlaot(5));
        make.height.equalTo(@(GTFixHeightFlaot(15)));
        make.width.mas_equalTo(kMainScreen_width/3);
    }];
    [self.noLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.kgLabel.mas_right).offset(1);
        make.top.mas_equalTo(self.typeLabel.mas_bottom).offset(GTFixHeightFlaot(5));
        make.height.equalTo(@(GTFixHeightFlaot(15)));
        make.width.mas_equalTo(kMainScreen_width/3);
    }];
    
}
@end

@implementation CargoTVCellThree
-(void)loadViews {
    self.demandLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:13] withColor:[UIColor blackColor] withText:@"需求车辆信息"];
    self.demandLabel.textAlignment = NSTextAlignmentCenter;
    self.leghtLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:12] withColor:[UIColor blackColor] withText:@"车长"];
    self.leghtLabel.textAlignment = NSTextAlignmentCenter;
    self.typeLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:12] withColor:[UIColor blackColor] withText:@"车型"];
    self.typeLabel.textAlignment = NSTextAlignmentCenter;
    self.miLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:12] withColor:[UIColor grayColor] withText:@"10M"];
    self.miLabel.textAlignment = NSTextAlignmentCenter;
    self.heightLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:12] withColor:[UIColor grayColor] withText:@"高栏"];
    self.heightLabel.textAlignment = NSTextAlignmentCenter;
    [self addSubview:self.demandLabel];
     [self addSubview:self.leghtLabel];
     [self addSubview:self.typeLabel];
     [self addSubview:self.miLabel];
     [self addSubview:self.heightLabel];
}
-(void)layoutViews {
    
    [self.demandLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(GTFixWidthFlaot(15)));
        make.top.equalTo(@(GTFixHeightFlaot(5)));
        make.height.equalTo(@(GTFixHeightFlaot(15)));
        make.width.equalTo(self.demandLabel.mas_width);
    }];
    [self.leghtLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(GTFixWidthFlaot(0)));
        make.top.mas_equalTo(self.demandLabel.mas_bottom).offset(GTFixHeightFlaot(5));
        make.height.equalTo(@(GTFixHeightFlaot(15)));
        make.width.mas_equalTo(kMainScreen_width/2);
    }];
    [self.typeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.leghtLabel.mas_right).offset(1);
        make.top.mas_equalTo(self.demandLabel.mas_bottom).offset(GTFixHeightFlaot(5));
        make.height.equalTo(@(GTFixHeightFlaot(15)));
        make.width.mas_equalTo(kMainScreen_width/2);
    }];
    [self.miLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(GTFixWidthFlaot(0)));
        make.top.mas_equalTo(self.leghtLabel.mas_bottom).offset(GTFixHeightFlaot(5));
        make.height.equalTo(@(GTFixHeightFlaot(15)));
        make.width.mas_equalTo(kMainScreen_width/2);
    }];
    [self.heightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.miLabel.mas_right).offset(1);
        make.top.mas_equalTo(self.leghtLabel.mas_bottom).offset(GTFixHeightFlaot(5));
        make.height.equalTo(@(GTFixHeightFlaot(15)));
        make.width.mas_equalTo(kMainScreen_width/2);
    }];
    
}
@end

@implementation CargoTVCellFour
-(void)loadViews {
    self.shipperLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:13] withColor:[UIColor blackColor] withText:@"货主信息"];
    self.headImage = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"touxiangMN"]];
    self.nameLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:12] withColor:[UIColor blackColor] withText:@"货张三"];
    self.numberLabel = [UILabel labelWithSize:[UIFont systemFontOfSize:12] withColor:[UIColor grayColor] withText:@"已发货230条"];
    [self addSubview:self.shipperLabel];
    [self addSubview:self.headImage];
    [self addSubview:self.nameLabel];
    [self addSubview:self.numberLabel];
}
-(void)layoutViews {
    
    [self.shipperLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(GTFixWidthFlaot(15)));
        make.top.equalTo(@(GTFixHeightFlaot(5)));
        make.height.equalTo(@(GTFixHeightFlaot(15)));
        make.width.equalTo(self.shipperLabel.mas_width);
    }];
    [self.headImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(GTFixWidthFlaot(15));
        make.top.mas_equalTo(self.shipperLabel.mas_bottom).offset(GTFixHeightFlaot(5));
        make.height.width.mas_equalTo(GTFixHeightFlaot(35));
    }];
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.headImage.mas_right).offset(GTFixHeightFlaot(5));
        make.top.mas_equalTo(self.shipperLabel.mas_bottom).offset(GTFixHeightFlaot(5));
        make.height.equalTo(@(GTFixHeightFlaot(15)));
        make.width.mas_equalTo(self.nameLabel.mas_width);
    }];
    [self.numberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.headImage.mas_right).offset(GTFixHeightFlaot(5));
        make.top.mas_equalTo(self.nameLabel.mas_bottom).offset(GTFixHeightFlaot(5));
        make.height.equalTo(@(GTFixHeightFlaot(15)));
        make.width.mas_equalTo(self.numberLabel.mas_width);
    }];
}

@end






